package com.kexio.gen.domain.entity;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.kexio.gen.config.JsonStringDeserializer;
import com.kexio.gen.config.JsonStringSerializer;

@TableName("gen_table_column")
public class GenTableColumn {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long tableId;
    private String columnName;
    private String propertyName;
    private String jdbcType;
    private String javaType;
    private Integer length;
    private Integer scale;
    private Boolean nullable;
    private String defaultValue;
    private Boolean isPk;
    private Boolean isTenantCol;
    private Boolean isLogicDelete;
    private Boolean isAuditCreated;
    private Boolean isAuditUpdated;
    private String comment;

    @TableField("validate_rules")
    @JsonSerialize(using = JsonStringSerializer.class)
    @JsonDeserialize(using = JsonStringDeserializer.class)
    private String validateRules; // JSON字符串，API返回时自动转为JSON对象
    private String dictCode;
    private String uiComponent;
    @TableField("ui_props")
    @JsonSerialize(using = JsonStringSerializer.class)
    @JsonDeserialize(using = JsonStringDeserializer.class)
    private String uiProps; // JSON字符串，API返回时自动转为JSON对象
    @TableField("query_behavior")
    @JsonSerialize(using = JsonStringSerializer.class)
    @JsonDeserialize(using = JsonStringDeserializer.class)
    private String queryBehavior; // JSON字符串，API返回时自动转为JSON对象
    @TableField("ext")
    @JsonSerialize(using = JsonStringSerializer.class)
    @JsonDeserialize(using = JsonStringDeserializer.class)
    private String ext; // JSON字符串，API返回时自动转为JSON对象
    
    // 新增字段支持前端优化功能
    private Boolean isListCol; // 是否在列表显示
    private Boolean isQueryCond; // 是否作为查询条件
    private Boolean isFormField; // 是否在表单显示
    private Integer uiOrder; // 前端显示顺序

    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }
    public Long getTableId() { return tableId; }
    public void setTableId(Long tableId) { this.tableId = tableId; }
    public String getColumnName() { return columnName; }
    public void setColumnName(String columnName) { this.columnName = columnName; }
    public String getPropertyName() { return propertyName; }
    public void setPropertyName(String propertyName) { this.propertyName = propertyName; }
    public String getJdbcType() { return jdbcType; }
    public void setJdbcType(String jdbcType) { this.jdbcType = jdbcType; }
    public String getJavaType() { return javaType; }
    public void setJavaType(String javaType) { this.javaType = javaType; }
    public Integer getLength() { return length; }
    public void setLength(Integer length) { this.length = length; }
    public Integer getScale() { return scale; }
    public void setScale(Integer scale) { this.scale = scale; }
    public Boolean getNullable() { return nullable; }
    public void setNullable(Boolean nullable) { this.nullable = nullable; }
    public String getDefaultValue() { return defaultValue; }
    public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; }
    public Boolean getIsPk() { return isPk; }
    public void setIsPk(Boolean isPk) { this.isPk = isPk; }
    public Boolean getIsTenantCol() { return isTenantCol; }
    public void setIsTenantCol(Boolean isTenantCol) { this.isTenantCol = isTenantCol; }
    public Boolean getIsLogicDelete() { return isLogicDelete; }
    public void setIsLogicDelete(Boolean isLogicDelete) { this.isLogicDelete = isLogicDelete; }
    public Boolean getIsAuditCreated() { return isAuditCreated; }
    public void setIsAuditCreated(Boolean isAuditCreated) { this.isAuditCreated = isAuditCreated; }
    public Boolean getIsAuditUpdated() { return isAuditUpdated; }
    public void setIsAuditUpdated(Boolean isAuditUpdated) { this.isAuditUpdated = isAuditUpdated; }
    public String getComment() { return comment; }
    public void setComment(String comment) { this.comment = comment; }
    public String getValidateRules() { return validateRules; }
    public void setValidateRules(String validateRules) { this.validateRules = validateRules; }
    public String getDictCode() { return dictCode; }
    public void setDictCode(String dictCode) { this.dictCode = dictCode; }
    public String getUiComponent() { return uiComponent; }
    public void setUiComponent(String uiComponent) { this.uiComponent = uiComponent; }
    public String getUiProps() { return uiProps; }
    public void setUiProps(String uiProps) { this.uiProps = uiProps; }
    public String getQueryBehavior() { return queryBehavior; }
    public void setQueryBehavior(String queryBehavior) { this.queryBehavior = queryBehavior; }
    public String getExt() { return ext; }
    public void setExt(String ext) { this.ext = ext; }
    public Boolean getIsListCol() { return isListCol; }
    public void setIsListCol(Boolean isListCol) { this.isListCol = isListCol; }
    public Boolean getIsQueryCond() { return isQueryCond; }
    public void setIsQueryCond(Boolean isQueryCond) { this.isQueryCond = isQueryCond; }
    public Boolean getIsFormField() { return isFormField; }
    public void setIsFormField(Boolean isFormField) { this.isFormField = isFormField; }
    public Integer getUiOrder() { return uiOrder; }
    public void setUiOrder(Integer uiOrder) { this.uiOrder = uiOrder; }
    public LocalDateTime getCreatedAt() { return createdAt; }
    public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
    public LocalDateTime getUpdatedAt() { return updatedAt; }
    public void setUpdatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; }
}


